package com.cike.basecatch;

import java.io.BufferedReader;
import java.io.FileReader;

/**
 * @ClassName com.basejavaer.basecatch.Test
 * @Description TODO
 */
public class CatchDemo {
    public static void main(String[] args) {
        /* 使用了java 的try-with-resources方式
        try (new BufferedReader(new FileReader("/home/cike/developerCodes/ideaProjects/logs/testFile/catchDemo.xml"))) {

        } catch (IOException e) {

        }*/
        BufferedReader buffread = null;

        try {
            String line;
            buffread = new BufferedReader(new FileReader("/home/cike/developerCodes/ideaProjects/logs/testFile/catchDemo.xml"));

            while ((line = buffread.readLine()) != null){
                System.out.println(line);
            }

        } catch (Exception e){

        } finally {

            try{
                if(buffread != null){
                    buffread.close();
                }
            }catch (Exception e){

            }

        }


    }
}
